import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

public class Test {
    public static void main(String[] args) throws IOException {
        //文件输入流从文件中读取字节数据
        //FileinputStream                                                                                                                                                                                
        //创建流
        InputStream inputStream=new FileInputStream("C:\\Users\\Administrator\\Desktop\\Java\\day32\\test.txt");
        System.out.println("InputSteam:"+inputStream);
        //使用流
        // int r =inputStream.read();
        // System.out.println("r:"+r);
        // r=inputStream.read();
        // System.out.println("r:"+r);
        // r=inputStream.read();
        // System.out.println("r:"+r);
        byte[] bytes=new byte[10];
        int r =inputStream.read(bytes);
        System.out.println("r:"+r);
        int length =inputStream.read(bytes);
        System.out.println("length:"+length);
        for(int i=0;i<length;i++){
        System.out.println(bytes[i]);
        }
       //关闭流
       inputStream.close();
    }
}                    